package com.zx.cloud.domain;

import java.time.OffsetDateTime;
import java.util.ArrayList;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.zx.cloud.domain.enums.GenderEnum;
import com.zx.cloud.model.BasicDomain;
import com.zx.cloud.util.converter.jackson.OffsetDateTimeToIso8601Serializer;

import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.ToString;

/**
 * 
 * sys_user-用户表
 *
 */
@ToString
@EqualsAndHashCode(callSuper = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(value = {"hibernateLazyInitializer", "handler", "fieldHandler"}, ignoreUnknown = true)
public class User extends BasicDomain{

	private static final long serialVersionUID = 1L;
	
	private String channelCode;//渠道编码
	private String verifyCode;//审核编码
	
	public String getChannelCode() {
		return channelCode;
	}

	public void setChannelCode(String channelCode) {
		this.channelCode = channelCode;
	}

	public String getVerifyCode() {
		return verifyCode;
	}

	public void setVerifyCode(String verifyCode) {
		this.verifyCode = verifyCode;
	}

	
	/**
	 * 登录用户名
	 */
	@ApiModelProperty(value = "登录用户名")
    private String username;
	/**
	 * 登录密码
	 */
	@ApiModelProperty(value = "登录密码")
    private String password;
	/**
	 * 姓名
	 */
	@ApiModelProperty(value = "姓名")
    private String fullname;
	/**
	 * 性别：1男2女
	 */
	@ApiModelProperty(value = "性别：1男2女")
    private GenderEnum gender;
	/**
	 * 是否管理员：1是0否
	 */
	@ApiModelProperty(value = "是否管理员：1是0否")
    private String phone;
	/**
	 * 外键，所属部门Id
	 */
	@ApiModelProperty(value = "外键，所属部门Id")
    private String departmentId;
	/**
	 * 是否锁定：1是0否
	 */
	@ApiModelProperty(value = "是否锁定：1是0否")
    private String image;
	/**
	 * 0:正常,1:删除,2:禁用
	 */
	@ApiModelProperty(value = "0:正常/启用,1:删除,2:禁用")
    private Integer status;
	/**
	 * 记录生成人
	 */
	@ApiModelProperty(value = "记录生成人")
    private String createUser;
	/**
	 * 记录生成时间
	 */
	@ApiModelProperty(value = "记录生成时间")
	@JsonSerialize(using = OffsetDateTimeToIso8601Serializer.class)
    private OffsetDateTime createDate;
	/**
	 * 最后更新人
	 */
	@ApiModelProperty(value = "最后更新人")
    private String updateUser;
	/**
	 * 最后更新时间
	 */
	@ApiModelProperty(value = "最后更新时间")
	@JsonSerialize(using = OffsetDateTimeToIso8601Serializer.class)
    private OffsetDateTime updateDate;
    
	@ApiModelProperty(value = "角色id")
	private List<Long> roleIds=new ArrayList<Long>();
	
	private Long roleId;
	
	private UserRole userRole;
	
	private String name;
	/**
	 * 旧密码
	 */
	private String oldPWD;
	/**
	 * 本次登陆时间
	 * */
	private OffsetDateTime loginDate;
	/**
	 * 上次登陆时间
	 */
	private OffsetDateTime beforeLoginDate;
	/**
	 * 本次登錄ip
	 */
	private String loginIp;
	/**
	 * 上次登陆ip
	 */
	private String beforeLoginIp;
	
    public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public UserRole getUserRole() {
		return userRole;
	}

	public void setUserRole(UserRole userRole) {
		this.userRole = userRole;
	}

	public User(){
    
    }
    
    public List<Long> getRoleIds() {
		return roleIds;
	}

	public void setRoleIds(List<Long> roleIds) {
		this.roleIds = roleIds;
	}

	public String getUsername() {
        return this.username;
    }
    
    public void setUsername(String username) {
        this.username = username;
    }
    public String getPassword() {
        return this.password;
    }
    
    public void setPassword(String password) {
        this.password = password;
    }
    public String getFullname() {
        return this.fullname;
    }
    
    public void setFullname(String fullname) {
        this.fullname = fullname;
    }
    public GenderEnum getGender() {
        return this.gender;
    }
    
    public void setGender(GenderEnum gender) {
        this.gender = gender;
    }
    public String getPhone() {
        return this.phone;
    }
    
    public void setPhone(String phone) {
        this.phone = phone;
    }
    public String getDepartmentId() {
        return this.departmentId;
    }
    
    public void setDepartmentId(String departmentId) {
        this.departmentId = departmentId;
    }
    public String getImage() {
        return this.image;
    }
    
    public void setImage(String image) {
        this.image = image;
    }
    public Integer getStatus() {
        return this.status;
    }
    
    public void setStatus(Integer status) {
        this.status = status;
    }
    public String getCreateUser() {
        return this.createUser;
    }
    
    public void setCreateUser(String createUser) {
        this.createUser = createUser;
    }
    public OffsetDateTime getCreateDate() {
        return this.createDate;
    }
    
    public void setCreateDate(OffsetDateTime createDate) {
        this.createDate = createDate;
    }
    public String getUpdateUser() {
        return this.updateUser;
    }
    
    public void setUpdateUser(String updateUser) {
        this.updateUser = updateUser;
    }
    public OffsetDateTime getUpdateDate() {
        return this.updateDate;
    }
    
    public void setUpdateDate(OffsetDateTime updateDate) {
        this.updateDate = updateDate;
    }

	public Long getRoleId() {
		return roleId;
	}

	public void setRoleId(Long roleId) {
		this.roleId = roleId;
	}

	public String getOldPWD() {
		return oldPWD;
	}

	public void setOldPWD(String oldPWD) {
		this.oldPWD = oldPWD;
	}

	public OffsetDateTime getLoginDate() {
		return loginDate;
	}

	public void setLoginDate(OffsetDateTime loginDate) {
		this.loginDate = loginDate;
	}

	public OffsetDateTime getBeforeLoginDate() {
		return beforeLoginDate;
	}

	public void setBeforeLoginDate(OffsetDateTime beforeLoginDate) {
		this.beforeLoginDate = beforeLoginDate;
	}

	public String getLoginIp() {
		return loginIp;
	}

	public void setLoginIp(String loginIp) {
		this.loginIp = loginIp;
	}

	public String getBeforeLoginIp() {
		return beforeLoginIp;
	}

	public void setBeforeLoginIp(String beforeLoginIp) {
		this.beforeLoginIp = beforeLoginIp;
	}
	
    
}